package org.cpoy.eims.entity;

// Generated Feb 24, 2011 8:45:00 AM by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.NotNull;

/**
 * StudentCerficate generated by hbm2java
 */
@Entity
@Table(name = "student_cerficate")
public class StudentCerficate implements java.io.Serializable {

	private int id;
	private Student student;
	private Certificate certificate;
	private boolean receivedStatus;
	private Set<StudentCertificateLocation> studentCertificateLocations = new HashSet<StudentCertificateLocation>(
			0);

	public StudentCerficate() {
	}

	public StudentCerficate(int id, Student student, Certificate certificate,
			boolean receivedStatus) {
		this.id = id;
		this.student = student;
		this.certificate = certificate;
		this.receivedStatus = receivedStatus;
	}

	public StudentCerficate(int id, Student student, Certificate certificate,
			boolean receivedStatus,
			Set<StudentCertificateLocation> studentCertificateLocations) {
		this.id = id;
		this.student = student;
		this.certificate = certificate;
		this.receivedStatus = receivedStatus;
		this.studentCertificateLocations = studentCertificateLocations;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "student_id", nullable = false)
	@NotNull
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "certificate_id", nullable = false)
	@NotNull
	public Certificate getCertificate() {
		return this.certificate;
	}

	public void setCertificate(Certificate certificate) {
		this.certificate = certificate;
	}

	@Column(name = "received_status", nullable = false)
	public boolean isReceivedStatus() {
		return this.receivedStatus;
	}

	public void setReceivedStatus(boolean receivedStatus) {
		this.receivedStatus = receivedStatus;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "studentCerficate")
	public Set<StudentCertificateLocation> getStudentCertificateLocations() {
		return this.studentCertificateLocations;
	}

	public void setStudentCertificateLocations(
			Set<StudentCertificateLocation> studentCertificateLocations) {
		this.studentCertificateLocations = studentCertificateLocations;
	}

}
